package collection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;

public class AddAll {
    public static void main(String[] args)
    {
        Collection c=new ArrayList();
        c.add("java");
        c.add("c++");
        c.add(".net");
        System.out.println(c);//[java, c++, .net]
        Collection c1=new HashSet();
        c1.add("java");
        c1.add("ios");
        c1.add("android");
        System.out.println(c1);//[java, android, ios]
        c.addAll(c1);
        System.out.println(c);//[java, c++, .net, java, android, ios]
        c1.addAll(c);
        System.out.println(c1);//[c++, java, android, .net, ios]




    }
}
